package com.pf.java;

import javax.naming.NameParser;
import java.util.*;

/**
 * @author pf
 * @data 2021/11/1-11:01
 */
public class hashMap {
    public static void main(String[] args) {
        Map map = null;

//        map = new Hashtable();
//        map.put("Tony", null);
//        map.put(null, null);

        map = new HashMap();
        map.put("Lily",null);
        map.put("John",null);
        map.put("Mary",null);
        map.put(null,null);
        map.put(null,null);
        System.out.println(map);

        for (Object key : map.keySet()) {
            System.out.println(key + " " + map.get(key));
        }

        map = new LinkedHashMap();
        map.put("a" , 1);
        map.put("b" , 12);
        map.put("c" , 14);
        map.put("d" , 55);
        map.put("e" , 31);
        map.put("f" , 61);
        System.out.println(map);

        for (Object key : map.keySet()) {
            System.out.println(key + " " + map.get(key));
        }
    }
}
